﻿#ifndef NOTES_H
#define NOTES_H

#include <QDialog>
#include <QFile>
#include <QFileInfo>
#include <QTextBlock>
#include <QCloseEvent>
#include <QTextStream>
#include <QScreen>
#include <QColor>
#include <QMenu>
#include <QAction>
#include <QDebug>
#include <QFont>
#include <QFontDialog>
#include <QColorDialog>
#include <tstruct.h>
#include <QClipboard>
#include <QDesktopServices>
#include <QPrinter>

namespace Ui {
class notes;
}

class notes : public QDialog
{
    Q_OBJECT

public:

    explicit notes(QString filename,QHash<QString, NoteT> *hashNote, QWidget *parent = nullptr);
    ~notes();
    void saveToFile(const QString &fileName, const QString &content);
    QString filePath = "";
    QString oldFilePath = "";
    QString content = "";
    bool filestatus = true;

    //设置主题
    QColor backGroundColor;
    QColor fontColor;
    void setcolor();

    //使用hash结构体
    QHash<QString, NoteT> *nt;
    QString title;

private slots:
    void onCustomContextMenu(const QPoint &pos);

private:
    Ui::notes *ui;
    void closeEvent(QCloseEvent *event);

signals:
    void sigClose();

};

#endif // NOTES_H
